const { Builder, Browser, By, Key, until } = require('selenium-webdriver')

    ; (async function example() {
        let driver = await new Builder().forBrowser('chrome').build()
        try {
            await driver.get('https://www.baidu.com')
            // 找到元素,输入内容,点回车
            await driver.findElement(By.id('kw')).sendKeys('黑马程序员', Key.RETURN)
            // 验证是否成功
            await driver.wait(until.titleIs('黑马程序员'), 10000)
        } finally {
            // await driver.quit()
        }
    })()